#include "application.h"
#include "state.h"
#include "state_stack.h"
#include "debug_helper.h"
#include "tag.h"

#include <iostream>
#include <exception>

using namespace krryn::core;

application::application() : m_Stack(state_stack::get_instance()) {}

application::~application(){
	state_stack::delete_instance();
}

void application::run(){
	redirect_io(redirect_error);

	std::clog << "Hello!" << std::endl;    
	m_Stack.push(":intro");

	while(!m_Stack.empty()){
		m_Stack.current().tick();
	}

	std::clog << "Bye, bye!" << std::endl;
}
